from PIL import Image
from IPython.display import display
# Open images and resize them to the same size (200x200 pixels in this example)
image1 = Image.open("./C1.png").resize((1500, 1500))
image2 = Image.open("./C2.jpg").resize((1500, 1500))
image3 = Image.open("./C3.webp").resize((1500, 1500))
image4 = Image.open("./C5.jpeg").resize((1500, 1500))
# image5 = Image.open("./images/C5.jpeg").resize((800, 800))
# image6 = Image.open("./images/image6.png").resize((800, 800))
# image7 = Image.open("./images/image7.png").resize((800, 800))
# image8 = Image.open("./images/image8.png").resize((800, 800))
# Create a new image with the dimensions of a 2x4 grid of images
width, height = image1.size
total_width = width * 4
total_height = height * 1
collage_image = Image.new('RGB', (total_width, total_height))
# Paste the images into the collage image
collage_image.paste(im=image1, box=(0, 0))
collage_image.paste(im=image2, box=(width, 0))
collage_image.paste(im=image3, box=(width*2, 0))
collage_image.paste(im=image4, box=(width*3, 0))
# collage_image.paste(im=image5, box=(0, height))
# collage_image.paste(im=image6, box=(width, height))
# collage_image.paste(im=image7, box=(width*2, height))
# collage_image.paste(im=image8, box=(width*3, height))
# Display the collage image in the notebook
display(collage_image)